package com.yupi.springbootinit.demo;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
@ConfigurationProperties(prefix = "querys")
@PropertySources({@PropertySource(value = "classpath:aaaa.yml",encoding = "utf-8"),})
@Configuration
@Data
public class querys {
    private List<QueryConfig> queries = new ArrayList<>();
    private  List<String> table;
    private   List<String> columns;
    @Data
    public static class QueryConfig {
        private String table;
        private List<FieldMapping> fields;
        @Data
        public static class FieldMapping {
            private String name;
            private String alias;
        }
    }

}
